GetSimilarity
TheGetSimilarity
function compares a compressed image to a picture stored in a pixel map and returns a value indicating the relative similarity of the two images.
pascal OSErr GetSimilarity (PixMapHandle src, const Rect *srcRect, ImageDescriptionHandle desc, Ptr data, Fixed *similarity);
src
- Contains a handle to the noncompressed image. The image must be stored in a pixel map structure.
srcRect
- Contains a pointer to a rectangle defining the portion of the image to compare to the compressed image. This rectangle should be the same size as the image described by the image description structure specified by the
desc
parameter.desc
- Specifies a handle to the image description structure that defines the compressed image for the operation.
data
- Points to the compressed image data. This pointer must contain a 32-bit clean address.
similarity
- Contains a pointer to a field that is to receive the similarity value. The compressor sets this field to reflect the relative similarity of the two images. Valid values range from 0 (completely different) to 1.0 (identical).
RESULT CODES
noErr 0 No error paramErr -50 Invalid parameter specified memFullErr -108 Not enough memory available noCodecErr -8961 The Image Compression Manager could not find the specified compressor